import request from '@/router/axios'

//分页查询未分配配送单的配镜单(门店配送)
export function getUnDeliverySaleByPage(query) {
  return request({
    url: '/eims/delivery/getUnDeliverySaleByPage',
    method: 'get',
    params: query
  })
}

//分页查询未分配配送单的配镜单(隐形配送)
export function getInvisibleSaleByPage(query) {
  return request({
    url: '/eims/delivery/getInvisibleUnDeliverySaleByPage',
    method: 'get',
    params: query
  })
}

//获取需要隐形配送的门店信息列表(隐形配送)
export function getNeedDeliveryDeptList(query) {
  return request({
    url: '/eims/delivery/getNeedDeliveryDeptList',
    method: 'get',
    params: query
  })
}
//分页查询未分配配送单的配镜单(加工配送)
export function getWorkUnDeliverySaleByPage(query) {
  return request({
    url: '/eims/delivery/getWorkUnDeliverySaleByPage',
    method: 'get',
    params: query
  })
}
//查询配送记录
export function getDeliveryByPage(query) {
  return request({
    url: '/eims/delivery/page',
    method: 'get',
    params: query
  })
}
//统计配送商品数量
export function getGoodsNumberSum(query) {
  return request({
    url: '/eims/delivery/getDeliveryGoodsNumberSum',
    method: 'post',
    data: query
  })
}

//  门店配送
export function addDeliveryObj(obj) {
  return request({
    url: '/eims/delivery',
    method: 'post',
    data: obj
  })
}

//  隐形配送
export function addInvisibleDelivery(obj) {
  console.log(obj);
  return request({
    url: '/eims/delivery/invisible',
    method: 'post',
    data: obj
  })
}

//  加工配送
export function addWorkingDelivery(obj) {
  return request({
    url: '/eims/delivery/work',
    method: 'post',
    data: obj
  })
}

export function getDeliveryObj(id) {
  return request({
    url: '/eims/delivery/' + id,
    method: 'get'
  })
}

export function delDeliveryObj(id) {
  return request({
    url: '/eims/delivery/' + id,
    method: 'delete'
  })
}

export function putDeliveryObj(obj) {
  return request({
    url: '/eims/delivery',
    method: 'put',
    data: obj
  })
}
